<?php

namespace app\api\controller\v1;

use app\common\controller\Api;

/**
 * 航拍/全景
 */
class Panorama extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    public function _initialize()
    {
        parent::_initialize();
    }

    /**
     * 列表
     * @internal $page 页数
     */
    public function list()
    {
        $page   = input('page', 1);
        $limit  = 10;
        $lx     = input('lx', 0);
        $where['lx'] = $lx;
        $panorama = model("NewhousePanorama");
        $total = $panorama->where($where)->count();
        $result = $panorama->where($where)->order('createtime desc')
            ->paginate($limit, $total, ['page' => $page]);

        if ($result) {
            $this->success('操作成功', $result);
        } else {
            $this->error($this->auth->getError());
        }
    }
}
